/**
 * 解析url参数
 * @example ?id=123&a=b
 * @return Object {id:123,a:b}
 */

 export function urlParse () {
   let url = window.location.search.substr(1)
   let obj = {}
   url = url.split('&')
   url.forEach((item) => {
     let arr = item.split('=')
     let key = decodeURIComponent(arr[0])
     let val = decodeURIComponent(arr[1])
     obj[key] = val
   })
   return obj
 }
